﻿using Easy.Services.DbContexts;
using Easy.Services.Entities;
using Easy.Services.Interface;
using System.Linq.Expressions;

namespace Easy.Services.Core
{
    internal class RolePermissionRelationService: IRolePermissionRelationService
    {
       

        public bool AddBatch(List<RolePermissionRelation> relations)
        {
            using MySQLDbContext db = new();
            BaseService<RolePermissionRelation> baseService = new(db);
            return  baseService.AddBatchBase(relations);

        }


        public List<RolePermissionRelation> GetList(Expression<Func<RolePermissionRelation, bool>> expression = null)
        {
            using MySQLDbContext db = new();
            BaseService<RolePermissionRelation> baseService = new(db);
            return baseService.GetList(expression);

        }

        public bool UpdateBatch(List<RolePermissionRelation> relations)
        {
            using MySQLDbContext db = new();
            BaseService<RolePermissionRelation> baseService = new(db);
            return baseService.UpdateBatchBase(relations);

        }



    }
}
